package com.code.day22;

import java.lang.reflect.Array;
import java.util.Arrays;

public class Test01 {
    public static void main(String[] args) {
        //1.获取BookShelf这个class对象
        Class<BookShelf> bookShelfClass = BookShelf.class;
        //2.判断这个类上有没有Book这个注解
        boolean annotationPresent = bookShelfClass.isAnnotationPresent(Book.class);
        //3.获取Book注解
        if (annotationPresent) {
            Book book = bookShelfClass.getAnnotation(Book.class);
            System.out.println(book.bookName());
            System.out.println(book.price());
            System.out.println(Arrays.toString(book.author()));
            System.out.println(book.count());
        }
    }
}
